Handle the case that the protocol version in the context is not set yet.
authorMatthias Clasen <mclasen@redhat.com>
Wed, 3 Nov 2004 17:06:38 +0000 (17:06 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 3 Nov 2004 17:06:38 +0000 (17:06 +0000)
2004-11-03  Matthias Clasen  <mclasen@redhat.com>

* gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the
case that the protocol version in the context is not
set yet.  (#157123, James Henstridge)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkdnd-x11.c

index 0f5ebd5b391e6e353becc271570fa8ff6a337fe4..dd1f43ce117fc0d029482ae8cea5f520c35d6094 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the 
+       case that the protocol version in the context is not 
+       set yet.  (#157123, James Henstridge)
+
        * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't
        try to activate a node if the cursor is not valid.  
 
index 0f5ebd5b391e6e353becc271570fa8ff6a337fe4..dd1f43ce117fc0d029482ae8cea5f520c35d6094 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the 
+       case that the protocol version in the context is not 
+       set yet.  (#157123, James Henstridge)
+
        * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't
        try to activate a node if the cursor is not valid.  
 
index 0f5ebd5b391e6e353becc271570fa8ff6a337fe4..dd1f43ce117fc0d029482ae8cea5f520c35d6094 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the 
+       case that the protocol version in the context is not 
+       set yet.  (#157123, James Henstridge)
+
        * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't
        try to activate a node if the cursor is not valid.  
 
index 0f5ebd5b391e6e353becc271570fa8ff6a337fe4..dd1f43ce117fc0d029482ae8cea5f520c35d6094 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the 
+       case that the protocol version in the context is not 
+       set yet.  (#157123, James Henstridge)
+
        * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't
        try to activate a node if the cursor is not valid.  
 
index 5eb2cd7ddf361c22618f7ce30f0c388143dcaaac..4a7a599851c4093fb966be3bedaba2602f22bbd1 100644 (file)
@@ -3231,7 +3231,27 @@ gdk_drag_motion (GdkDragContext *context,
   
   if (private->old_actions != possible_actions)
     private->xdnd_actions_set = FALSE;
-      
+  
+  if (protocol == GDK_DRAG_PROTO_XDND && private->version == 0)
+    {
+      /* This ugly hack is necessary since GTK+ doesn't know about
+       * the XDND protocol version, and in particular doesn't know 
+       * that gdk_drag_find_window_for_screen() has the side-effect 
+       * of setting private->version, and therefore sometimes call
+       * gdk_drag_motion() without a prior call to 
+       * gdk_drag_find_window_for_screen(). This happens, e.g.
+       * when GTK+ is proxying DND events to embedded windows.
+       */ 
+      if (dest_window)
+       {
+         GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
+         
+         xdnd_check_dest (display, 
+                          GDK_DRAWABLE_XID (dest_window), 
+                          &private->version);
+       }
+    }
+
   /* When we have a Xdnd target, make sure our XdndActionList
    * matches the current actions;
    */